import './index.less';
import { Button, TabBar, Badge } from 'antd-mobile/es';
import {
  AppOutline,
  GiftOutline,
  AppstoreOutline,
  UserOutline,
} from 'antd-mobile-icons';
import { history } from 'umi';
import { useEffect } from 'react';

export default function home(props: any) {
  //跳转页面地址
  const setRoute = (val: any) => {
    console.log(val);
    history.push(val);
  };
  return (
    <div className="layout">
      {/* <h1>{count}：秒后跳转首页</h1> */}
      {props.children}
      <div className="tabbar">
        <TabBar onChange={setRoute} activeKey={props.location.pathname}>
          <TabBar.Item
            icon={<AppOutline />}
            title="首页"
            key="/homes/home"
          ></TabBar.Item>
          <TabBar.Item
            icon={<AppstoreOutline />}
            title="分类"
            key="/homes/cate"
          ></TabBar.Item>
          <TabBar.Item
            icon={<GiftOutline />}
            title="购物车"
            key="/homes/cart"
          ></TabBar.Item>
          <TabBar.Item
            icon={<UserOutline />}
            title="个人中心"
            key="/homes/my"
          ></TabBar.Item>
        </TabBar>
      </div>
    </div>
  );
}
